/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * TrainingBook
 * Copyright (C) Arnaud Duval 2010 <arnaud.duval@gmail.com>
 * 
 * Projects is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Projects is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _LAP_HISTORY_HPP_
#define _LAP_HISTORY_HPP_

#include <libxml++/libxml++.h>
#include <rich-track-point.hpp>
#include <fstream>


///@class LapHistory
///@brief Defines the container for the data recorded during a lap of activity
class LapHistory
{
public:
    ///@brief Default constructor
    LapHistory();
    ///@brief Copy constructor
    LapHistory(const LapHistory&);
    ///@brief Destructor
    ~LapHistory();
    ///@brief Overoad of = operator
    LapHistory& operator=(const LapHistory&);
    ///@brief Read lap history from a XML node in a TCX file
    void ReadFromTcxFile(xmlpp::Node*);
    ///@brief Parse a XML node corrseponding to a track in a TCX file
    void ParseTrackNodeFromTcxFile(xmlpp::Node*);
    ///@brief Write to a file containing the history
    void WriteXML(std::ofstream&);
    ///@brief Append recorded DateTime entries to a given list
    void AppendToDateTimeList(std::list<DateTime> &);
    ///@brief Read from a file containing the history
    void ReadHistoryFile(xmlpp::Node*);
    ///@brief Return the track
    std::vector<RichTrackPoint> GetTrack();
    ///@brief Return the number of points
    unsigned int GetNumberOfPoints();
    
private:
    std::vector<RichTrackPoint> trackPoints;
    
    
};






#endif